package homework;

import java.util.HashMap;

public class Work7 {
	public static void main(String[] args) {
		HashMap<Character, Integer> map1=new HashMap<Character, Integer>();
		HashMap<Character, Integer> map2=new HashMap<Character, Integer>();
		
		String str1="ppRYYGrrYB225";
		String str2="YrR8RrY";
		for(int i=0;i<str1.length();i++){
			if(map1.containsKey(str1.charAt(i))){
				map1.put(str1.charAt(i), map1.get(str1.charAt(i))+1);
			}else{
				map1.put(str1.charAt(i), 1);
			}
		}
		for(int i=0;i<str2.length();i++){
			if(map2.containsKey(str2.charAt(i))){
				map2.put(str2.charAt(i), map2.get(str2.charAt(i))+1);
			}else{
				map2.put(str2.charAt(i), 1);
			}
		}
		boolean flage=true;
		for(Character c:map2.keySet()){
			if(map1.containsKey(c)){
				if(map1.get(c)<=map2.get(c)){
					System.out.println("NO");
					flage=false;
					break;
				}
			}else{
				System.out.println("NO");
				flage=false;
				break;
			}
		}
		if(flage){
			System.out.println("YES  "+(str1.length()-str2.length()));
		}

	}
}
